<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
        <!-- 引入Vue库 -->
        <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    </head>
    <body>
        <div id="root"></div>
    </body>
    <script>
        Vue.createApp({
            data() {
                return {
                    hello: "hello world",
                    isShow: true,
                };
            },
            methods: {
                buttonClick() {
                    this.isShow = !this.isShow;
                },
            },
            template: `
        <div v-if="isShow">{{hello}}</div> 
        <button @click="buttonClick">显示/隐藏</button>
    `,
        }).mount("#root");
    </script>
</html>
